package com.ican.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractUITag;

import com.opensymphony.xwork2.util.ValueStack;

public class PageUITag extends AbstractUITag {

    private static final long serialVersionUID = 1L;
    private String pageBean;
    private String action;
    private String paramsKey;

    @Override
    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
        return new PageUIBean(stack, req, res);
    }

    @Override
    protected void populateParams() {
        super.populateParams();
        PageUIBean pageUIBean = (PageUIBean) component;
        pageUIBean.setPageBean(pageBean);
        pageUIBean.setAction(action);
        pageUIBean.setCssClass(cssClass);
        pageUIBean.setParamsKey(paramsKey);
    }
    
    public void setPageBean(String pageBean) {
        this.pageBean = pageBean;
    }
    public void setAction(String action) {
        this.action = action;
    }
    public void setParamsKey(String paramsKey) {
        this.paramsKey = paramsKey;
    }
}
